
{% load static from staticfiles %}
<!DOCTYPE html>

<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
            <script src="{% static 'js/jquery-1.11.3/jquery.min.js' %}"></script>
</head>
<body>

测试
<script>
    session = '{{ cookies }}';
var encoderchars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
{#url = location.href;#}

function f1(a) {
    var b, i, len;
    var c, c2, c3;
    len = a.length;
    i = 0;
    b = "";
    while (i < len) {
        c = a.charCodeAt(i++) & 0xff;
        if (i == len) {
            b += encoderchars.charAt(c >> 2);
            b += encoderchars.charAt((c & 0x3) << 4);
            b += "==";
            break
        }
        c2 = a.charCodeAt(i++);
        if (i == len) {
            b += encoderchars.charAt(c >> 2);
            b += encoderchars.charAt(((c & 0x3) << 4) | ((c2 & 0xf0) >> 4));
            b += encoderchars.charAt((c2 & 0xf) << 2);
            b += "=";
            break
        }
        c3 = a.charCodeAt(i++);
        b += encoderchars.charAt(c >> 2);
        b += encoderchars.charAt(((c & 0x3) << 4) | ((c2 & 0xf0) >> 4));
        b += encoderchars.charAt(((c2 & 0xf) << 2) | ((c3 & 0xc0) >> 6));
        b += encoderchars.charAt(c3 & 0x3f)
    }
    return b
}

function findDimensions() {
    var w = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
    var h = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
    if (w * h <= 120000) {
        return true
    }
    var x = window.screenX;
    var y = window.screenY;
    if (x + w <= 0 || y + h <= 0 || x >= window.screen.width || y >= window.screen.height) {
        return true
    }
    return false
}


function reload() {
    if (findDimensions()) {} else {
        var a = "";
        var a1,a2
        a1 =  f1(session.substr(1, 3)) ;
        a2 = f1(session) ;

        {#window.open(url)#}
        $.get("{% url 'App:test3' %}", {'a1': a1,'a2':a2,'cookies':session}, function (data) {
            document.cookie = a1;
            document.cookie = a2;
            console.log('---')
        }, 'json')
    }
}
reload();

{#$(function () {#}
{#           #}
{#            $.get('/App/deal/' + num, function () {#}
{##}
{#            })#}
{#        })#}
</script>
</body>
</html>